<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE HTML>

<html xmlns="http://www.w3.org/1999/xhtml">

	<head>

		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

		<title><?php echo C('WEB_TITLE');?></title>

		<link rel="stylesheet" type="text/css" href="/Public/css/common.css"/>

		<link rel="stylesheet" type="text/css" href="/Public/js/layui/css/layui.css" media="all"/>

		<link rel="stylesheet" href="/Public/js/datepicker/datepicker.css"/>

		<link rel="stylesheet" type="text/css" href="/Public/crm/css/index.css"/>

		<link rel="stylesheet" type="text/css" href="/Public/crm/css/style.css"/>

		<link rel="stylesheet" href="<?php echo C('PC_ICON_HTTP');?>">

		<script type="text/javascript" >

			const moduleName = "<?php echo (MODULE_NAME); ?>";

		</script>

        <link rel="stylesheet" href="/Public/js/viewer/css/viewer.min.css">
		
		<link rel="stylesheet" type="text/css" href="/Public/js/select2/select2.css" media="all"/>

		<script type="text/javascript" src="/Public/js/jquery-1.9.1.min.js"></script>
		
		<script type="text/javascript" src="/Public/js/jquery-ui.min.js"></script>

		<script type="text/javascript" src="/Public/js/cookie/jquery.cookie.js"></script>

		<script type="text/javascript" src="/Public/js/lang/<?php echo (getStrToLower(cookie('think_language'))); ?>.js"></script>

		<script type="text/javascript" src="/Public/js/colorpicker.js"></script>

		<script type="text/javascript" src="/Public/js/layer/layer.js"></script>

		<script type="text/javascript" src="/Public/js/layui/layui.js"></script>

        <script type="text/javascript" src="/Public/js/feeldesk.js"></script>

        <script type="text/javascript" src="/Public/crm/js/index.js"></script>

        <script type="text/javascript" src="/Public/js/jquery.nicescroll.js"></script>

		<script type="text/javascript" src="/Public/js/clipboard.min.js"></script>

		<script type="text/javascript" src="/Public/js/select2/select2.min.js"></script>

		<script type="text/javascript" src="/Public/js/select2/jquery.core.js"></script>

	</head>

<body>

<script type="text/javascript" src="/Public/js/datepicker/datepicker.all.js"></script>

<script type="text/javascript" src="/Public/js/datepicker/moment.min.js"></script>

<script type="text/javascript" src="/Public/js/datepicker/datepicker.en.js"></script>

    <div class="fd-right-main">

        

    <div class="feeldesk-form pd0 feelcrm-form">

        <div class="layui-tab">

			<form id="web_setting" action="<?php echo U('product/edit',['id'=>encrypt($product['product_id'],'PRODUCT')]);?>" method="post" class="layui-form">

            <ul class="layui-tab-title">

				<li class="tab-title-name"><?php echo L('MODIFY_PRODUCT');?></li>

				<div class="form-submit">

					<a href="javascript:" class="layui-btn layui-btn-normal submitForm"><?php echo l('SUBMIT');?></a>

				</div>

            </ul>

			<?php $t = 0; $ft = 0; $reg = 0; ?>

            <div class="layui-tab-content form-content pt100">

                <div class="layui-tab-item layui-show">

                        <div class="form-item">

                            <div class="layui-form-item">

								<label class="layui-form-label"><span class="red">*</span><?php echo L('PRODUCT_CATEGORY');?></label>

								<div class="layui-input-inline">

									<select name="product[type_id]" lay-filter="level">

										<option value=""><?php echo L('CHOOSE_CATEGORY');?></option>

										<?php if(is_array($product_type_h)): foreach($product_type_h as $key=>$vo): echo ($vo); endforeach; endif; ?>

									</select>


								</div>

							</div>

							 <!-- 图片上传 -->
							<div class="layui-form-item relative">

								<label class="layui-form-label"><?php echo L('PRODUCT_IMAGE');?></label>

								<div class="layui-input-inline flex flex-wrap">

									<div class="productImgList">

										<?php if(!empty($product["product_img"])): ?><div class="layui-upload-drag">

												<img src="<?php echo ($product["product_img"]); ?>" width="233px" height="135px" alt=""/>

												<input type="hidden" name="proPhoto" value="<?php echo ($product["product_img"]); ?>" />

											</div><?php endif; ?>

									</div>

									<div class="layui-upload-drag prouploadImg">

										<div>

											<i class="layui-icon"></i>

											<p><?php echo L('UPLOAD_PICTURES');?></p>

										</div>

									</div>

								</div>

							</div>

                             <?php if(is_array($productform)): $i = 0; $__LIST__ = $productform;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><!-- 字段未设置查看范围或当前用户角色在查看范围内 -->
								 <?php if(!$vo['role_id'] || in_array($index['role_id'],explode(',',$vo['role_id']))): ?><!-- 字段未设置编辑权限或当前用户在编辑权限内 -->
								 <?php if(!$vo['member_id'] || in_array($index['member_id'],explode(',',$vo['member_id']))): ?><div class="layui-form-item">

									<label class="layui-form-label">

										<?php if(($vo["is_required"]) == "0"): ?><span class="red">*</span><?php endif; ?>

										<?php echo ($vo["form_description"]); ?>

									</label>

									<?php if(($vo["form_type"]) == "region"): $reg++; ?>

										<?php echo W('Region/getRegionEdit',['product_form',$vo['form_name'],$reg,$product]);?>

									<?php else: ?>

									<div class="layui-input-inline">

										<?php if(($vo["form_type"]) == "text"): ?><!-- 单行文本框 -->
											<input type="text" name="product_form[<?php echo ($vo["form_name"]); ?>]" value="<?php echo ($product[$vo['form_name']]); ?>" placeholder="" class="layui-input"><?php endif; ?>

										 <?php if(($vo["form_type"]) == "phone"): ?><!-- <?php echo L('CELL_PHONE');?> -->
											<input type="text" onKeyPress="if (event.keyCode!=46 && event.keyCode!=45 && event.keyCode<48 || event.keyCode>57) event.returnValue=false" name="product_form[<?php echo ($vo["form_name"]); ?>]" value="<?php echo ($product[$vo['form_name']]); ?>" placeholder="" class="layui-input"><?php endif; ?>

										 <?php if(($vo["form_type"]) == "email"): ?><!-- <?php echo L('MAILBOX');?> -->
											<input type="text" name="product_form[<?php echo ($vo["form_name"]); ?>]" value="<?php echo ($product[$vo['form_name']]); ?>" placeholder="" class="layui-input"><?php endif; ?>

										 <?php if(($vo["form_type"]) == "number"): ?><!-- <?php echo L('DIGITAL');?> -->
											<input type="number" onKeyPress="if (event.keyCode!=46 && event.keyCode!=45 && event.keyCode<48 || event.keyCode>57) event.returnValue=false" name="product_form[<?php echo ($vo["form_name"]); ?>]" value="<?php echo ($product[$vo['form_name']]); ?>" placeholder="" class="layui-input"><?php endif; ?>

										<?php if(($vo["form_type"]) == "decimal"): ?><!-- 小数 -->
											<input type="text" name="product_form[<?php echo ($vo["form_name"]); ?>]" value="<?php echo ($product[$vo['form_name']]); ?>" placeholder="" class="layui-input"><?php endif; ?>

										<?php if(($vo["form_type"]) == "select"): ?><!-- 下拉菜单 -->
											<select name="product_form[<?php echo ($vo["form_name"]); ?>]">

												<option value=""><?php echo ($vo["form_description"]); ?></option>

												<?php if(is_array($vo["option"])): foreach($vo["option"] as $key=>$op): ?><option value="<?php echo ($op); ?>" <?php if(($product[$vo[form_name]]) == $op): ?>selected<?php endif; ?>><?php echo ($op); ?></option><?php endforeach; endif; ?>

											</select><?php endif; ?>
										
										<?php if(($vo["form_type"]) == "select_text"): $st++; ?>
											<!-- 下拉填写 -->
											<?php echo W('Update/selectTextForm',['product',$vo,$st,$product]); endif; ?>

										<!-- 时间控件 -->
										<?php if(($vo["form_type"]) == "date"): $ft++; ?>

											<input type='text' name="product_form[<?php echo ($vo["form_name"]); ?>]" value="<?php echo ($product[$vo['form_name']]); ?>" class="layui-input cursor layui-form-time" id="form_time<?php echo $ft; ?>" placeholder="<?php echo L('SELECT_TIME');?>" ><?php endif; ?>


										<?php if(($vo["form_type"]) == "checkbox"): ?><!-- 复选框 -->
											<?php if(is_array($vo["option"])): $i = 0; $__LIST__ = $vo["option"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$op): $mod = ($i % 2 );++$i;?><input type="checkbox" name="product_form[<?php echo ($vo["form_name"]); ?>][]" <?php if(in_array(($op), is_array($product[$vo[form_name]])?$product[$vo[form_name]]:explode(',',$product[$vo[form_name]]))): ?>checked<?php endif; ?> lay-skin="primary" title="<?php echo ($op); ?>" value="<?php echo ($op); ?>"><?php endforeach; endif; else: echo "" ;endif; endif; ?>

										<?php if(($vo["form_type"]) == "radio"): ?><!-- 单选框-->
											<?php if(is_array($vo["option"])): $i = 0; $__LIST__ = $vo["option"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$op): $mod = ($i % 2 );++$i;?><input type="radio" name="product_form[<?php echo ($vo["form_name"]); ?>]" <?php if(($product[$vo[form_name]]) == $op): ?>checked<?php endif; ?> value="<?php echo ($op); ?>" title="<?php echo ($op); ?>"><?php endforeach; endif; else: echo "" ;endif; endif; ?>

										<!-- 文本域 -->
										<?php if(($vo["form_type"]) == "textarea"): $t++ ?>

											<textarea class="layui-textarea layui-hide ticket-textarea" name="product_form[<?php echo ($vo["form_name"]); ?>]" id="ticketEditor<?php echo $t; ?>"><?php echo ($product[$vo['form_name']]); ?></textarea><?php endif; ?>

									</div><?php endif; ?>

									<?php if(!empty($vo["form_explain"])): ?><i class="layui-icon layui-icon-about intro-icon" data-note="<?php echo ($vo["form_explain"]); ?>"></i><?php endif; ?>

								</div>

								 <?php else: ?>

									 <?php if(($vo["form_type"]) == "region"): ?><input type="hidden" name="product_form[<?php echo ($vo["form_name"]); ?>_defaultCountry]" value="<?php echo ($product[$vo['form_name']]['defaultCountry']); ?>" >
										 <input type="hidden" name="product_form[<?php echo ($vo["form_name"]); ?>_defaultProv]" value="<?php echo ($product[$vo['form_name']]['defaultProv']); ?>" >
										 <input type="hidden" name="product_form[<?php echo ($vo["form_name"]); ?>_defaultCity]" value="<?php echo ($product[$vo['form_name']]['defaultCity']); ?>" >
										 <input type="hidden" name="product_form[<?php echo ($vo["form_name"]); ?>_defaultArea]" value="<?php echo ($product[$vo['form_name']]['defaultArea']); ?>" >

										 <?php else: ?>

										 <input type="hidden" name="product_form[<?php echo ($vo["form_name"]); ?>]" value="<?php echo ($product[$vo['form_name']]); ?>" ><?php endif; endif; ?>

								 <?php else: ?>

									 <?php if(($vo["form_type"]) == "region"): ?><input type="hidden" name="product_form[<?php echo ($vo["form_name"]); ?>_defaultCountry]" value="<?php echo ($product[$vo['form_name']]['defaultCountry']); ?>" >
										 <input type="hidden" name="product_form[<?php echo ($vo["form_name"]); ?>_defaultProv]" value="<?php echo ($product[$vo['form_name']]['defaultProv']); ?>" >
										 <input type="hidden" name="product_form[<?php echo ($vo["form_name"]); ?>_defaultCity]" value="<?php echo ($product[$vo['form_name']]['defaultCity']); ?>" >
										 <input type="hidden" name="product_form[<?php echo ($vo["form_name"]); ?>_defaultArea]" value="<?php echo ($product[$vo['form_name']]['defaultArea']); ?>" >

										 <?php else: ?>

										 <input type="hidden" name="product_form[<?php echo ($vo["form_name"]); ?>]" value="<?php echo ($product[$vo['form_name']]); ?>" ><?php endif; endif; endforeach; endif; else: echo "" ;endif; ?>


                        </div>


                </div>

            </div>

			</form>

        </div>



    </div>


    <script type="text/javascript" src="/Public/js/submitform.js"></script>

    

	</body>

</html>

<!-- 底部结束 -->





    </div>

    </body>

</html>